package com.itheima.controller;

import com.itheima.pojo.JobOption;
import com.itheima.pojo.OperateLog;
import com.itheima.pojo.Result;
import com.itheima.pojo.StudentCountOption;
import com.itheima.service.EmpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author: zhengsuyang
 * @Desc:
 * @create: 2025-09-09 17:01
 **/
@RestController
@RequestMapping("/report")
@Slf4j
public class ReportController {
    @Autowired
    private EmpService empService;
    /**
     * 统计各个职位的员工人数
     * @return
     */
    @GetMapping("/empJobData")
    public Result getEmpJobData(){
      JobOption jobOption = empService.getEmpJobData();
      return Result.success(jobOption);
    }

    /**
     * 统计各个性别员工的人数
     * @return
     */
    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
     List<Map> genderData =empService.getEmpGenderData();
     return Result.success(genderData);
    }
    /**
     * 统计各个班级的学生人数
     */
    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
      StudentCountOption studentCountData = empService.getStudentCountData();
      return Result.success(studentCountData);
    }

    /**
     * 统计各个学历的学生人数
     * @return
     */
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
      List<Map> mapList = empService.getStudentDegreeData();
        return Result.success(mapList);
    }
}
